package com.alibaba.citrus.ots.platform.enhance.api;

import com.alibaba.citrus.ots.platform.enhance.dto.api.request.*;
import com.alibaba.citrus.ots.platform.enhance.sdo.OrganizationRelationSDO;
import com.alibaba.citrus.ots.platform.enhance.sdo.OrganizationSDO;
import com.alibaba.cz.base.tool.page.PageResult;
import com.alibaba.cz.base.tool.result.Result;
import com.alibaba.lattice2.epoch.meshflow.model.annotation.MeshFlowService;

import java.util.List;

/**
 * @author zhoubc
 * @description: TODO
 * @date 2021/9/3 12:20
 */
@MeshFlowService(apps = {"bc_ots"}, name = "organizationQueryService")
public interface OrganizationQueryService {

    /**
     * 查询所有组织，树形结构
     * @return
     */
    Result<List<OrganizationSDO>> getAllOrganization();

    /**
     * 查询单个组织明细，包括关联的渠道，货品组
     * @param request
     * @return
     */
    Result<OrganizationSDO> getOrganizationDetail(IdQueryRequest request);

    /**
     * 查询上级组织信息
     * @return
     */
    Result<OrganizationSDO> getParentOrganization(IdQueryRequest request);

    /**
     * 向上查询某个组织到指定的节点 ,默认 103-分子公司业务单元,,,,,bizType限制
     * @return
     */
    Result<List<OrganizationSDO>> getTopOrganizationList(IdQueryRequest request);

    /**
     * 查询组织下的所有子孙组织，树形结构,,,,,bizType限制
     * @return
     */
    Result<List<OrganizationSDO>> getAllChildOrganizations(IdQueryRequest request);

    /**
     * 查询组织下的所有子孙组织,,,,,bizType限制
     * @return
     */
    Result<List<OrganizationSDO>> getAllChildOrganizationList(IdQueryRequest request);

    /**
     * 获取员工所在组织结构
     * @return
     */
    Result<List<OrganizationSDO>> getEmployeeOrganiztion(IdQueryRequest request);

    /**
     * 根据组织id获取组织货品组关联信息
     * @param request
     * @return
     */
    Result<PageResult<List<OrganizationRelationSDO>>> getOrgScItemGroupRelationByOrgId(IdQueryRequest request);

    /**
     * 根据组织id获取组织渠道关联信息
     * @param request
     * @return
     */
    Result<PageResult<List<OrganizationRelationSDO>>> getOrgChannelRelationByOrgId(IdQueryRequest request);

}
